home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Classic Games for OS/2 Warp
/
Classic Games for OS2 Warp (1995)(IBM).iso
/
fpdesk.cmd
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-07-19
|
3KB
|
80 lines
/* Rebuild All FUNPAK folders & icons */
rc = RxFuncAdd( "SysCreateObject", "RexxUtil", "SysCreateObject" )
rc = RxFuncAdd( "SysCreateShadow", "RexxUtil", "SysCreateShadow" )
rc = RxFuncAdd( "SysSetObjectData", "RexxUtil", "SysSetObjectData" )
rc = RxFuncAdd( "SysOpenObject", "RexxUtil", "SysOpenObject" )
rc = RxFuncAdd( "SysDriveMap", "RexxUtil", "SysDriveMap" )
rc = RxFuncAdd( "SysFileTree", "RexxUtil", "SysFileTree" )
rc = RxFuncAdd( "SysDriveInfo", "RexxUtil", "SysDriveInfo" )
Dir = "\FUNPAK"
Class = "WPFolder"
Title = "Family FunPak"
Loc = "<WP_DESKTOP>"
Setup = "OBJECTID=<FPFOLDER>" || ,
";ICONFILE=" || Dir || "\FUNPAK0.ICO" || ,
";ICONNFILE=1," || Dir || "\FUNPAK1.ICO"
Opts = "Replace"
call SysCreateObject Class, Title, Loc, Setup, Opts
call SysOpenObject "<FPFOLDER>", "Icon", "0"
/* Search Drives for home Dir: */
Map = SysDriveMap( , "LOCAL" )
Done.0 = 0 /*Keep track of which objects were created*/
Uninst = 0
Do I=1 to Words(Map)
Drive = Strip( Word(Map, I) )
Say "Drive = " || Drive
Say "SysDriveInfo() returns: " || SysDriveInfo(Drive)
/* Check if Drive is Accessable */
If ( (SysDriveInfo(Drive) \= "" ) & ,
(Strip(Word(SysDriveInfo, 2)) \= "0") ) then Do
/* get directories under home dir: */
rc = SysFileTree( Drive || Dir || "\*.*", "File.", "DO" )
Do J=1 to File.0
/* Add UnInstall Program! and animated icons */
If (Uninst == 0) then do
ok = SysCreateShadow( Drive || Dir || "\UNINST.CMD", "<FPFOLDER>" )
Uninst = 1
IconSetup = "ICONFILE=" || Drive || Dir || "\FUNPAK0.ICO" || ,
";ICONNFILE=1," || Drive || Dir || "\FUNPAK1.ICO"
ok = SysSetObjectData( "<FPFOLDER>", IconSetup )
End
/* Check is this app was already added */
P = LastPos( "\", File.J )
AppName = Right( File.J, Length(File.J)-P )
IsDone = 0
Do K = 1 to Done.0
If (AppName == Done.K ) then
IsDone = 1
End
/* Find "MAKEOBJ.CMD" under subdirs of home dir: */
If (IsDone == 0) & ( SysFileTree( File.J || "\MAKEOBJ.CMD", "FO" ) == 0 ) then Do
/* MakeObj.cmd found; run it to create OBJs for all apps */
"@call " || File.J || "\MAKEOBJ.CMD"
/* Add this app to the done list */
X = Done.0 + 1
Done.X = AppName
Done.0 = Done.0 + 1
End
End /*Do J*/
End
End